<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>在线考试系统</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/admin/launchExam.css">
    <script src="/node_modules/tinymce/tinymce.min.js"></script>
    <!-- <script src="./node_modules/@dimakorotkov/tinymce-mathjax/config.js" type="text/javascript"
        charset="utf-8"></script> -->
    <script>
        tinymce.init({
            selector: '#answerA',
            language: 'zh_CN',
            plugins: 'mathjax image',
            setup: function (editor) {
                editor.on('change', function () {
                    editor.save();
                });
            },
            images_upload_base_path: '/dir', //图片存放目录
            images_upload_url: '/file/uploadtinyImg',   //上传地址
            toolbar: [
                'undo redo | styleselect | bold italic | link image | alignleft aligncenter alignright | mathjax',
            ],
            mathjax: {
                lib: '/node_modules/mathjax/es5/tex-mml-chtml.js', //required path to mathjax
                configUrl: '/node_modules/@dimakorotkov/tinymce-mathjax/config.js' //optional: mathjax config js
            }

        });
        tinymce.init({
            selector: '#answerB',
            language: 'zh_CN',
            plugins: 'mathjax image',
            setup: function (editor) {
                editor.on('change', function () {
                    editor.save();
                });
            },
            images_upload_base_path: '/dir', //图片存放目录
            images_upload_url: '/file/uploadtinyImg',   //上传地址
            toolbar: [
                'undo redo | styleselect | bold italic | link image | alignleft aligncenter alignright | mathjax',
            ],
            mathjax: {
                lib: '/node_modules/mathjax/es5/tex-mml-chtml.js', //required path to mathjax
                configUrl: '/node_modules/@dimakorotkov/tinymce-mathjax/config.js' //optional: mathjax config js
            }

        });
        tinymce.init({
            selector: '#answerC',
            language: 'zh_CN',
            plugins: 'mathjax image',
            setup: function (editor) {
                editor.on('change', function () {
                    editor.save();
                });
            },
            images_upload_base_path: '/dir', //图片存放目录
            images_upload_url: '/file/uploadtinyImg',   //上传地址
            toolbar: [
                'undo redo | styleselect | bold italic | link image | alignleft aligncenter alignright | mathjax',
            ],
            mathjax: {
                lib: './node_modules/mathjax/es5/tex-mml-chtml.js', //required path to mathjax
                configUrl: './node_modules/@dimakorotkov/tinymce-mathjax/config.js' //optional: mathjax config js
            }

        });
        tinymce.init({
            selector: '#answerD',
            language: 'zh_CN',
            plugins: 'mathjax image',
            setup: function (editor) {
                editor.on('change', function () {
                    editor.save();
                });
            },
            images_upload_base_path: '/dir', //图片存放目录
            images_upload_url: '/file/uploadtinyImg',   //上传地址
            toolbar: [
                'undo redo | styleselect | bold italic | link image | alignleft aligncenter alignright | mathjax',
            ],
            mathjax: {
                lib: './node_modules/mathjax/es5/tex-mml-chtml.js', //required path to mathjax
                configUrl: './node_modules/@dimakorotkov/tinymce-mathjax/config.js' //optional: mathjax config js
            }

        });
    </script>
</head>

<body>
    <%- include ("../publicEjs/public.ejs")%>

    <div class="container-fluid" style="margin-top: 80px;">
        <div class="row">
            <%- include ("../publicEjs/adminLeft.ejs")%>
            <div class="col-9" style="padding-bottom: 30px;">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title">上传题目截图请注意</h5>
                        <p class="card-text">为保证题目的清晰度，规定截图宽不得小于800px,出题教师可以在下面预览处预览图片，如果发现模糊请重新上传</br>
                            一道题目只允许存在一张题目截图</br>
                            截图文件名不得出现“.” “$”等符号
                        </p>
                    </div>
                    <div class="card-body" style="padding-top: 0;">
                        <h5 class="card-title">图片预览区</h5>
                    </div>
                    <div id="imgyulan">
                        <img src="/images/exam1.png" class="card-img-top">
                    </div>
                </div>

                <form id="uploadForm" method="post" enctype="multipart/form-data" style="display: none;">
                    <input type="file" name="fileImg" id="picture" accept='image/*'>
                </form>

                <button onclick="upload()" class="btn btn-secondary" style="display: block;margin: 10px 0;"
                    type="button">上传截图</button>

                <h5 style="margin: 20px 0">编辑选项</h5>
                <div class="form-group row">
                    <label for="inputEmail3" class="col-sm-1 col-form-label">A选项</label>
                    <div class="col-sm-9 tinymce">
                        <textarea type="text" class="form-control " id="answerA" required></textarea>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="inputPassword3" class="col-sm-1 col-form-label">B选项</label>
                    <div class="col-sm-9 tinymce">
                        <textarea type="text" class="form-control " id="answerB" required></textarea>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="inputPassword3" class="col-sm-1 col-form-label">C选项</label>
                    <div class="col-sm-9 tinymce">
                        <textarea type="text" class="form-control " id="answerC" required></textarea>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="inputPassword3" class="col-sm-1 col-form-label">D选项</label>
                    <div class="col-sm-9 tinymce">
                        <textarea type="text" class="form-control " id="answerD" required></textarea>
                    </div>
                </div>
                <div id="answerCon">
                    <div class="form-group row">
                        <label for="inputState" class="col-sm-1 col-form-label">正确选项</label>
                        <div class="col-sm-9">
                            <select class="relAnswer form-control" required>
                                <option selected>请选择正确答案</option>
                                <option value="A">A</option>
                                <option value="B">B</option>
                                <option value="C">C</option>
                                <option value="D">D</option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <button type="button" onclick="addAnswer()" class="btn btn-secondary">+ 多选请添加</button>
                </div>
                <div class="form-group row">
                    <label for="inputPassword3" class="col-sm-1 col-form-label">分值</label>
                    <div class="col-sm-9">
                        <input type="number" class="form-control" id="subjectValue" required>
                    </div>
                </div>
                <div class="form-group row">
                    <label for="inputPassword3" class="col-sm-1 col-form-label">试题解析</label>
                    <div class="col-sm-9">
                        <input type="text" placeholder="略" class="form-control" id="remark">
                    </div>
                </div>
                <input style="display: none;" type="text" class="form-control" value="<%=list.examWordId%>"
                    id="examWordId">
                <input style="display: none;" type="text" class="form-control" value="<%=list.subjectNumber%>"
                    id="subjectNumber">
                <input style="display: none;" type="text" class="form-control" value="<%=list.test_WordId%>"
                    id="testWordId">


                <button id="save" onclick="save()" class="btn btn-primary" style="display: block;margin: 5px 0 10px;"
                    type="button">保存试题</button>
                <small class="text-muted">
                    当前剩余任务点：<%=list.lack%>
                </small>
            </div>
        </div>
    </div>

    <%- include ("../publicEjs/foot.ejs")%>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.slim.min.js"
        integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
        integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
        crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"
        integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
        crossorigin="anonymous"></script>
    <script src="/js/jquery.js"></script>
    <script src="/js/backstage/addpage.js"></script>
    <script src="/js/admin/publicTea.js"></script>
</body>

</html>